//
//  MyOrderListController.m
//  StarOrangeStaff
//
//  Created by lshenrong on 2020/7/19.
//  Copyright © 2020 lshenrong. All rights reserved.
//

#import "MyOrderListController.h"
#import "OrderChildController.h"
#import "MyOderListAPI.h"

@interface MyOrderListController ()

@end

@implementation MyOrderListController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"我的订单";
    
    [self setUpAllViewController];
    [self configSegmentStyle];
    
}

#pragma mark - segment style

- (void)configSegmentStyle{
    [self setUpTitleEffect:^(UIColor *__autoreleasing *titleScrollViewColor, UIColor *__autoreleasing *norColor, UIColor *__autoreleasing *selColor, UIFont *__autoreleasing *titleFont, CGFloat *titleHeight, CGFloat *titleWidth) {
        *norColor = kGrayColor;
        *selColor = kBlueColor;
        *titleScrollViewColor = kSeparateLineColor;
        //*titleHeight = 100;
        *titleFont = PingFangZhongChangGuiForFont(15);
        *titleWidth = SCREEN_WIDTH / 4;
    }];
    [self setUpUnderLineEffect:^(BOOL *isUnderLineDelayScroll, CGFloat *underLineH, UIColor *__autoreleasing *underLineColor, BOOL *isUnderLineEqualTitleWidth) {
        *underLineColor = kBlueColor;
        *underLineH = 1.5;
        *isUnderLineEqualTitleWidth = YES;
    }];
    [self setUpContentViewFrame:^(UIView *contentView) {
        CLog(@"GetRectNavAndStatusHight %f",GetRectNavAndStatusHight);
        CGFloat height = 64;
        if (IsPhoneX) {
            height = 88;
        }
        contentView.frame = CGRectMake(0, 100, SCREEN_WIDTH, SCREEN_HEIGHT-GetRectNavAndStatusHight);
    }];

}

// 添加所有子控制器
- (void)setUpAllViewController{
    NSArray *array  = @[ @"全部", @"待处理", @"进行中",@"待完成"];
    for (NSInteger i = 0; i<[array count]; i++) {
        OrderChildController *vc1 = [[OrderChildController alloc] init];
        vc1.getStatus = i + 1;
        vc1.title = array[i];
        [self addChildViewController:vc1];
    }
}



@end
